IApi.AddVariable 方法

新增一个使用者定义变数。

命名空间IntervalZero.KINGSTAR.Base.Api

组合: IntervalZero.KINGSTAR.Base.Api (于 IntervalZero.KINGSTAR.Base.dll) 版本:4.4.0.0

语法

C#VB
KsReturn<UserVariable> AddVariable(
       string Name,
       KsLogDataType Type,
       UserVariable Parent = null,
       long FolderSize = 0
)
Function AddVariable(
       Name As String,
       Type As KsLogDataType,
       Parent = null As UserVariable,
       Long As FolderSize = 0
) As KsReturn(Of UserVariable)

参数

Name

型别:string

变数名称。

 

Type

型别:KsLogDataType

变数的资料型别。

 

Parent

型别:UserVariable

预设值:null

UserVariable 的父资料夹,预设会将变数加到根资料夹中。

 

FolderSize

型别:long

预设值:0

新增 logDirectory 变数后,您可使用 FolderSize 设定资料夹大小。预设最多可新增 64 个 UserVariable。

回传值

型别:KsReturn<UserVariable>

回传一个 KsError 代码及一个使用者定义变数。

备注

可用的 EtherCAT 状态

ecatOffline, ecatInit, ecatBoot, ecatPreOP, ecatSafeOP, ecatOP

范例

C#
N/A

参见

IApi 介面

IntervalZero.KINGSTAR.Base.Api 命名空间